package com.nulstudio.sppm.Dao;

import com.nulstudio.sppm.Entities.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserInfoMapper {
    int addUserInfo(UserInfo userInfo);

    int checkMatched(@Param("account") String account, @Param("password") String password);

    int checkExisted(@Param("account") String account);

    int checkRepeatedUName(@Param("uName") String uName);

    UserInfo getInfoByAccount(@Param("account") String account);

    UserInfo getInfoByUid(@Param("uid") int uid);

    int modifyName(@Param("uid") String uid, @Param("name") String name);

    int checkExistedUid(@Param("uid") int uid);

    int modifyAuthority(@Param("uid")String uid,@Param("authority")String authority);
    int modifyPassword(@Param("uid")String uid,@Param("password")String password);
    int deleteUser(@Param("uid")int uid);
    List<UserInfo> getAllUsers();

    int modifyUserInfo(UserInfo userInfo);

    int getLastId();
    String getAuthorityById(int id);
}
